package com.money.mvp_dagger_simple.ui.module;

import com.money.mvp_dagger_simple.presenter.ILoginPresenter;
import com.money.mvp_dagger_simple.presenter.impl.ILoginPresenterImpl;
import com.money.mvp_dagger_simple.scope.ActivityScope;
import com.money.mvp_dagger_simple.ui.activity.LoginActivity;
import com.money.mvp_dagger_simple.ui.view.LoginView;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Money on 2017/8/25.
 */
@ActivityScope
@Module
public class LoginActivityModule {

    private LoginActivity activity;
    private LoginView loginView;

    public LoginActivityModule(LoginActivity activity, LoginView loginView) {
        this.activity = activity;
        this.loginView = loginView;
    }

    @Provides
    @ActivityScope
    public LoginActivity provideLoginActivity(){
        return activity;
    }

    @Provides
    @ActivityScope
    public LoginView provideLoginView(){
        return loginView;
    }

    @Provides
    @ActivityScope
    public ILoginPresenter provideLoginPresenter(LoginActivity activity, LoginView view){
        return new ILoginPresenterImpl(activity, view);
    }

}
